﻿using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Application.Services;
using YaAppoint.CustomSettings;
using YaAppoint.Devices;
using YaAppoint.ExamAppies;

namespace YaAppoint.Appointments.AutoAppoint
{
    [RemoteService(isEnabled:false)]
    /// <summary>
    /// 预约计划服务
    /// </summary>
    public interface IAppointPlanAppService:IApplicationService
    {
        /// <summary>
        /// 统计每个设备对检查项目的支持程度
        /// </summary>
        /// <param name="applyItems">申请项目</param>
        /// <param name="deviceList">设备类型下所有设备</param>
        /// <returns></returns>
        DegreeFilter CalculateDeviceSupportDegree(List<ExamApplicationDto> applyItems, List<DeviceDto> deviceList);


        /// <summary>
        /// 统计申请项目的时间要求情况
        /// </summary>
        /// <param name="applyItems">申请项目</param>
        /// <returns></returns>
        TimeFilter GenerateTimeIntervalFilter(List<ExamApplicationDto> applyItems);

        /// <summary>
        /// 生成单个预约计划
        /// （针对自动预约后修改）
        ///  当医生需要修改自动预约方案时，选中申请项目(一个或多个)选中日期需要自动根据规则推荐可选号池时，使用本函数
        /// </summary>
        /// <param name="degreeFilter">设备支持情况统计对象</param>
        /// <param name="timeFilter">申请项目时间要求统计对象</param>
        /// <returns></returns>
        AppointPlan? GenerateAppointPlan(DegreeFilter degreeFilter, TimeFilter timeFilter,List<ExamApplicationDto> applyItems);


        /// <summary>
        /// 生成预约计划列表
        /// (针对自动生成预约方案)
        /// </summary>
        /// <param name="degreeFilter"></param>
        /// <param name="timeFilter"></param>
        /// <returns></returns>
        Task<List<AppointPlan>> GenerateAppointPlans(DegreeFilter degreeFilter, List<ExamApplicationDto> applyItems,CustomSettingDto globalSetting);


        /// <summary>
        /// 统计设备预约情况
        /// </summary>
        /// <param name="devices"></param>
        /// <returns></returns>
        Task<List<DeviceStatus>> CalculateDeviceStatus(List<DeviceDto> devices);



    }
}
